<form>
  <h2 mat-dialog-title>邀请组员</h2>
  <div mat-dialog-content>
    <mat-form-field class="full-width">
      <input matInput type="text"
                      placeholder="组员姓名"
                      [matAutocomplete]="auto"
                      aria-label="Number"
                      [formControl]="myControl"
      >
    </mat-form-field>
    <mat-form-field class="full-width">
      <input matInput type="text" placeholder="项目描述">
    </mat-form-field>
  </div>
  <div mat-dialog-actions>
    <button type="button"
            mat-raised-button
            color="primary"
            (click)="onClick"
    >保存</button>
    <button type="button" mat-raised-button mat-dialog-close>关闭</button>
  </div>
</form>

<!-- [displayWith]="displayUser"传入的是函数而不是返回结果 -->
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayUser">
  <mat-option *ngFor="let item of items" [value]="item">
    {{item.name}}
  </mat-option>
</mat-autocomplete>
